jQuery(document).ready(function() {
		$('html body.minha-conta form#aspnetForm div.mainContentWrapper div.content div.wrapper div.tabela-pedidos table#orderInfoProductList tbody tr:last-child').addClass('lastchild');
		if ( $('body').is('.carrinho') ) { 
			$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tbody tr td.preco-total').html('<span>'+$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tbody tr td.preco-total').html()+'</span>');

			/*$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div#ctl00_Conteudo_ctrPaginaSistemaAreaWrapper.sidebar div#ctl00_Conteudo_PaginaSistemaArea1_pnlPanel.prodContentContainer div#ctl00_Conteudo_PaginaSistemaArea1_ctl00_sugestaoPrateleira.prateleira h4').click(function() {
				$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div#ctl00_Conteudo_ctrPaginaSistemaAreaWrapper.sidebar div#ctl00_Conteudo_PaginaSistemaArea1_pnlPanel.prodContentContainer').fadeOut(200, function() {
					realinhar();
				});
			});
			
			setInterval(function() {
				$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div#ctl00_Conteudo_ctrPaginaSistemaAreaWrapper.sidebar div#ctl00_Conteudo_PaginaSistemaArea1_pnlPanel.prodContentContainer').fadeOut(200);
		         realinhar();
		    }, 30000);*/
			
			
		}
		if($("body").is('.frete')){
			$(".frete .tipoPagamento li").find("strong:first").addClass("title");
			$(".frete .tipoPagamento li").find("strong:eq(1)").addClass("price");
			$(".frete .tipoPagamento li:eq(1)").css("float", "right");
			$(".frete .tipoPagamento li").append("<input type='image' src='/arquivos/btn_usar_servico.png' />");
			
			$(".frete .tipoPagamento li input[type='image']").click(function(){
				$(this).parents("li").find("input[type='radio']").attr("checked", "checked");
				$(".frete .bts input[type='submit']").trigger("click");
			});
			$(".frete .tipoPagamento li label").click(function(){ return false; });
		}
		
		if($("body").is('.carrinho')){
		
			$(".texto-vale-presente, .texto-cepline").attr("colspan", "4");
			$(".mainContentWrapper .content h2").text("Meu Carrinho");
			$(".total .valor-total").text("Total:");
			$(".vale-presente, .txt-frete").attr("colspan", "1");
			$("table.carrinhoTable tbody tr:last").css("border-bottom", 0);
			if($(".subtotal td.preco-total").text() != "" && $(".subtotal td.preco-total").text() != "0,00"){
				var subtotal = parseFloat($(".subtotal td.preco-total").text().replace(/[^0-9\,]/gi, '').replace(',', '.'));
				var remaining = 0.00;
				if(subtotal < 100.00){
					remaining = 100.00 - subtotal;
					$(".subtotal td.txtSubTotal").html("Adicione <strong>R$" + remaining.toFixed(2) + ' ou mais</strong> e ganhe o <strong style="text-transform:uppercase;">frete inteiramente grátis!</strong>');
					$(".subtotal td.preco-total").html("Total em produtos: <strong>" + $(".subtotal td.preco-total").text() + "</strong>");
				}
			}else{
				$(".subtotal td.preco-total").html("Total em produtos: <strong>" + $(".subtotal td.preco-total").text() + "</strong>");
			}
			
			$(".carrinhoTable .vale-presente .preco-total").text($(".carrinhoTable .vale-presente .preco-total").text().replace(/[()]/gi, ""));
			$(".carrinhoTable .frete-gratis").text($(".carrinhoTable .frete-gratis").text().replace("+ ", ""));
			
			
		}
		
		adaptPage();
	});
	
$(document).ajaxComplete(function(){ adaptPage(); });

	function adaptPage(){
		if($("body").is('.forma-pagamento')){
			$(".lista-bandeiras li:eq(0) img").attr("src", "/arquivos/cartao_dinners.png");
			$(".lista-bandeiras li:eq(1) img").attr("src", "/arquivos/cartao_master.png");
			$(".lista-bandeiras li:eq(2) img").attr("src", "/arquivos/cartao_visa.png");
			$(".lista-boletos li img").attr("src", "/arquivos/boleto.png");
			$(".content h2:first").text("Formas de pagamento");
		}
	}
	
	/*function realinhar() {
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable').css('margin-top', '20px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.cepline td.texto-cepline').css('top', '305px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.vale-presente td.texto-vale-presente').css('top', '405px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.subtotal').css('top', '510px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.vale-presente td.vale-presente').css('top', '570px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.vale-presente td.preco-total').css('top', '570px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.cepline td.txt-frete').css('top', '590px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.cepline td.frete-gratis').css('top', '590px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.total td.valor-total').css('top', '614px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho table.carrinhoTable tfoot tr.total td.valor').css('top', '610px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho ul.bts.bottom').css('margin-top', '430px');
		$('html body#ctl00_home.carrinho form#aspnetForm div.mainContentWrapper div.content div#ctl00_Conteudo_pnlCarrinho.painelCarrinho div#ctl00_Conteudo_updcarrinho ul.bts.bottom li.finalizar-compra a').css('top', '670px');
	}*/